package com.my.cloud.config;

import feign.Logger;
import feign.Retryer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author zhupanlin
 * @version 1.0
 * @description: TODO
 * @date 2024/3/9 13:01
 */
@Configuration
public class FeignConfig {
    
    @Bean
    public Retryer myRetryer(){
        // Feign默认配置是不开启重试策略的
        return Retryer.NEVER_RETRY;
        
        // 最大请求次数为3，初始间隔时间为100s，重试最大间隔时间为1s
        //return new Retryer.Default(100, 1, 3);
    }
    
    @Bean
    Logger.Level feignLoggerLevel(){
        return Logger.Level.FULL;
    }
    
}
